# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-simplematch
pkgver=1.4
pkgrel=0
pkgdesc="Minimal, super readable string pattern matching"
url="https://github.com/tfeldmann/simplematch"
arch="noarch"
license="MIT"
makedepends="
	py3-gpep517
	py3-poetry-core
	py3-wheel
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/tfeldmann/simplematch/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/simplematch-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
fe11eed63cd5ec916cafbd61da77bda5049a4f5ed0dece36e21e2350625fa9fc77f2ecbfffe04d2414cc3d0b553a635543af6ed56eb1fbfc871ab33499995f00  py3-simplematch-1.4.tar.gz
"
